import { onMounted, ref } from "vue";

export function useWindow() {
	const width = ref(document.documentElement.clientWidth);
	const height = ref(document.documentElement.clientHeight);

	onMounted(() => {
		window.onresize = () => {
			return (() => {
				width.value = document.documentElement.clientWidth;
				height.value = document.documentElement.clientHeight;
			})();
		};
	});

	return {
		width,
		height,
	};
}
